import selfAxios from '@/utils/selfAxios';

export default {
    //获取商品信息列表数据和查询商品信息
    getList(page, size, searchMap) {
        return selfAxios({
            url: `/goods/list/${page}/${size}`,
            method: 'post',
            data: searchMap
        });
    },
    //新增商品信息
    add(goodsmsgData) {
        return selfAxios({
            url: '/goods',
            method: 'post',
            data: goodsmsgData
        });
    },
    //获取商品信息
    getGoodsMsg(id) {
        return selfAxios({
            url: `/goods/${id}`,
            method: 'get',
        });
    },
    //更新商品信息
    updateGoodsMsg(id, updatedData) {
        return selfAxios({
            url: `/goods/${id}`,
            method: 'put',
            data: updatedData
        });
    },
    //删除商品数据
    delGoodsData(id) {
        return selfAxios({
            url: `/goods/${id}`,
            method: 'delete',
        });
    }
}